import Mock from 'mockjs' 

Mock.setup({
  timeout: 100  //延时400ms请求到数据
  // timeout: 200 - 400 //延时200-400ms请求到数据
})

// 菜品列表数据
/* Mock.mock(RegExp("/jx/jxFoodManage/queryFoodsByKeyword"), /post|get/i, (options) => {
  return {
    code: 200,
    data: [],
  }
});  */

Mock.mock(RegExp("/wo/menu/list.*"), /post|get/i, (options) => {
  return {
    code: 200,
    data: [
      {
        menuList: [
          {url: '/index'},
          {url: '/os/all'},
          {url: '/os/allocation'},
          {url: '/os/unsigned'},
          {url: '/os/uncombine'},
          {url: '/os/tosign'},
          {url: '/user/list'},
        ]
      }
    ],
  }
}); 

Mock.mock(RegExp("/wo/demo/demo.*"), /post|get/i, (options) => {
  return Mock.mock({
    'list|5': [{
      'id|+1': 1,
      'name': '@cname',
      'age|18-60': 1,
      'menuList': '@email'
    }]
  })
}); 

export default {};
